package com.jemmyee.pizza.service;
import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.IRoleDao;
import com.jemmyee.pizza.entity.Role;
@Service("roleService")
public class RoleServiceImpl implements IRoleService<Role> {
	
    @Autowired
	private IRoleDao roleDao;

	public void delete(Role entity) {
		roleDao.delete(entity); 
	}

	public void deleteById(Serializable id) {
		roleDao.deleteById(id);
	}

	public Role findById(Serializable id) {
		return roleDao.findById(id);
	}

	public void save(Role entity) {
		roleDao.save(entity);
	}

	public void update(Role entity) {
		roleDao.update(entity);
	}

	public List<Role> findAll() {
		return roleDao.findAll(new Role());
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex,String order) {
		return roleDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public List<Role> findByProperty(String propertyName,
			Object value) {
		return roleDao.findByProperty(new Role(), propertyName, value);
	}

	public List<Role> findByCriteria(DetachedCriteria criteria) {
		return roleDao.findByCriteria(criteria);
	}

	public void deleteAll(List<Role> list) {
		// TODO Auto-generated method stub
		
	}
}
